@extends("admin.layouts.main")
<style>
	.my-ver-align{
		vertical-align: -2px;
	}
	.btn-link{
		color:gray !important;
        text-decoration: none !important;
	}
	.pagination{
	}
	.my-img,.my-img-ok{
		width:60px;
		height:60px;
		border:1px solid gray;
		border-radius: 50%;
        cursor: pointer;
	}
    .active{
        color:blue !important;
    }
    .show-img{
        position: fixed;
        top:0;
        left: 0;
        background: rgba(0,0,0,0.5);
        width: 100vw;
        height: 100vh;
        display: flex;
        align-items: center;
        justify-content: space-around;
        visibility: hidden;
        z-index: -1;
    }
    .my-exit{
        position: absolute;
        top:0;
        right:0;
        width:20px;
        height: 20px;
        cursor: pointer;

    }
</style>
@section("content")
<div class="container-fiuld p-3">
	<div class="card">
		<div class="card-header bg-transparent border-0">
			<ol class="breadcrumb pl-0 bg-transparent mb-0">
				<li class="breadcrumb-item pl-0"><a href="{{ route('guild.index') }}">公会列表</a></li>
				<li class="breadcrumb-item active"><a href='#'>主播列表</a></li>
			</ol>
		</div>
		<div class="card-body pt-0">
			<div class="row border border-secondary border-top-0 border-right-0 border-left-0 pb-2">
				<div class="col-lg-12 text-muted">
					<span class="my-ver-align">所属类目：</span>
					<a href="{{ route('guild.anchor', ['gid' => $gid, 'status' => 1]) }}"  class="btn btn-link @if($status == 1) active @endif">全部</a>
					<!--<a href="{{ route('guild.anchor', ['gid' => $gid, 'status' => 2]) }}"  class="btn btn-link @if($status == 2) active @endif">在线</a>
					<a href="#"  class="btn btn-link">工作</a>-->
					<a href="{{ route('guild.anchor', ['gid' => $gid, 'status' => 4]) }}"  class="btn btn-link @if($status == 4) active @endif">已认证</a>
					<a href="{{ route('guild.anchor', ['gid' => $gid, 'status' => 5]) }}"  class="btn btn-link @if($status == 5) active @endif">未认证</a>
					<!--<a href="#"  class="btn btn-link">黑名单</a>
					<a href="#"  class="btn btn-link">惩罚</a>-->
				</div>
			</div>
			<div class="row mt-3 mb-3">
				<div class="col-lg-12">
					<form class="form-inline">
						<label for="keyword">主播ID/主播昵称:</label>
						<input type="text" class="ml-4 mr-5 form-control" id="keyword" name="keyword" value="{{$search}}" placeholder="请选择">						
						<a class="btn btn-primary ml-1 mr-3 search text-white">查询</a>
						<button type="reset" class="btn btn-secondary">重置</button>
					</form>
				</div>
			</div>
			<div class="row">
				<div class="col-lg-12 table-responsive">
					<table class="table ">
						<thead class="thead-light">
							<tr class="text-dark">
								<th>主播ID</th>
								<th>主播昵称</th>
								<th class="text-center">头像</th>
								<th>姓名</th>
								<th>公会</th>
								<th>账户洽贝</th>
								<th>签约时间</th>
								<th>接受视频</th>
								<!--<th>星级</th>-->
								<th>视频（洽贝/分钟）</th>
								<th>语音（洽贝/分钟）</th>
								<!--<th>会员</th>-->
								<th>邮票</th>
								<th>提成比例</th>
								<!--<th>支付宝账号</th>-->
								<th>状态</th>
							</tr>
						</thead>
						<tbody>
							@foreach($anchor as $v)
							<tr>
								<td>{{ $v['user_id'] }}</td>
								<td>{{ $v['name'] }}</td>
								<td class="text-center">
									@if($v['avatars'])
									<img src="{{json_decode($v['avatars'], true)['url']}}" class="my-img">
                                    <p>通过</p>
									@else
									<img src="/img/avatar.png" class="my-img-ok">
                                    <p>未上传</p>
									@endif                                   
								</td>
								<td>{{ $v['realname'] }}</td>
								<td>{{ $v['guildtitle'] }}</td>
								<td>{{ $v['income'] }}</td>
								<td>{{ $v['updatetime'] }}</td>
								<td>{{ $v['is_video_check_name'] }}</td>
								<!--<td>4星</td>-->
								<td>{{ $v['video_money'] }}</td>
								<td>{{ $v['voice_money'] }}</td>
								<!--<td>300</td>-->
								<td>{{ $v['sum_income'] }}</td>
								<td>{{ $v['rate'] }}</td>
								<!--<td>18186228854</td>-->
								<td>{{ $v['status_name'] }}</td>
							</tr>
							 @endforeach
						</tbody>
					</table>
				</div>
			</div>
		</div>
		<div style="text-align: right;">
			@if(!empty($anchor))
            {{ $anchor->links('admin.layouts.paginate') }}
			@endif;
        </div>
	</div>
</div>
<div class="show-img">
    <div class="my-hide-img position-relative">
        <img src="/img/exit.png" class="my-exit">
        <img src="/img/avatar.png" class="show">
    </div>
</div>
@endsection

@section("js")
<script type="text/javascript">
    layui.use(['form', 'ori', "laydate"], function () {
        var form = layui.form,
            ori = layui.ori,
            dialog = layui.dialog,
            $ = layui.$;
        //重置
        ori.reset("[type=reset]");

        $(".my-img").click(function(){
            var $img = $(this);
            var src = $img.attr("src");
            $(".show").attr("src",src);
            $(".show-img").css({"visibility":"visible","zIndex":9999})
        });

        $(".my-exit,.show-img").click(function(e){
            e.stopPropagation();
            $(".show-img").css({"visibility":"hidden","zIndex":-1})
        })

        $('.search').click(function () {
            var keyword = $("#keyword").val();
			var status = {{$status}};
            location.href = "{{ route('guild.anchor', ['gid' => $gid]) }}" +'?keyword=' + keyword+'&status='+status;
        });
    });
</script>
@endsection
